<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>hello thymeleaf !</title>
    <script src="jquery.min.js"></script>
<body>
    <div>
        <form action="/updateUser" method="post">
            <input type="hidden" name="id" th:value="${user.id}">
            姓名：<input type="text" name="name" th:value="${user.name}"><br>
            年龄：<input type="number" name="age" th:value="${user.age}"><br>
            性别：<input name="sex" type="radio" checked="checked" value="男" th:field="${user.sex}"/>男<input name="sex" type="radio" value="女"  th:field="${user.sex}"/>女<br>
            角色：<select name="role">
                    <option th:each="r:${roles}" th:selected="${user.role==r.name}" th:text="${r.name}" th:value="${r.name}"></option>
                  </select><br>
            <input type="submit" value="添加">
        </form>
    </div>

</body>
</html>